using System;

using DesignByContract;

namespace Outcoding.GraphGenerator.Entities {
    public class SeriesAxis : IAxis{
        private class Constants{
            public const string DEFAULT_FONT_NAME = "Arial";
            public const int DEFAULT_FONT_SIZE = 12;
            public const bool DEFAULT_FONT_DECORATION_VALUE = false;
            public const string DEFAULT_FONT_COLOR = @"#000000";
        }

        #region Constructors

        public SeriesAxis() {
            mColor = Util.ColorTranslation(Constants.DEFAULT_FONT_COLOR);
        }

        #endregion

        private string mFontName = Constants.DEFAULT_FONT_NAME;

        private int mFontSize = Constants.DEFAULT_FONT_SIZE;

        private bool mIsFontBold = true;
        private bool mIsFontItalic = Constants.DEFAULT_FONT_DECORATION_VALUE;
        private bool mIsFontUnderline = Constants.DEFAULT_FONT_DECORATION_VALUE;

        private Label mTitle;

        public Label Title {
            get { return mTitle; }
            set { mTitle = value; }
        }


        public string FontName {
            get {
                return mFontName;
            }
            set {
                mFontName = value;
            }
        }

        public int FontSize {
            get {
                return mFontSize;
            }
            set {
                Check.Ensure(value > 0, "Size value cannot be less than zero.", new ArgumentOutOfRangeException());
                mFontSize = value;
            }
        }

        public bool IsFontBold {
            get {
                return mIsFontBold;
            }
            set {
                mIsFontBold = value;
            }
        }

        public bool IsFontItalic {
            get {
                return mIsFontItalic;
            }
            set {
                mIsFontItalic = value;
            }
        }

        public bool IsFontUnderline {
            get {
                return mIsFontUnderline;
            }
            set {
                mIsFontUnderline = value;
            }
        }

        private long mColor;

        public long Color
        {
            get { return mColor; }
            set { mColor = value; }
        }
    }
}
